xen/vcpu: Improve sanity checks in vcpu_create()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 15 Jan 2020 18:44:18 +0000 (18:44 +0000)
committerJulien Grall <julien@xen.org>
Thu, 16 Jan 2020 12:44:57 +0000 (12:44 +0000)
commitb6d41060120562e2185f2e3b5e582d415456ec65
tree406475d91688cef63b1ec3a58e2bde680886233c
parent1a42c2fcd29642ceaae9e5a12bb9c5c6f4b92813
xen/vcpu: Improve sanity checks in vcpu_create()

The BUG_ON() is confusing to follow.  The (!is_idle_domain(d) || vcpu_id) part
is a vestigial remnant of architectures poisioning idle_vcpu[0] with non-NULL
pointers.

Now that idle_vcpu[0] is NULL on all architectures, and d->max_vcpus specified
before vcpu_create() is called, we can properly range check the requested
vcpu_id.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <julien@xen.org>
xen/common/domain.c